package o;

import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import androidx.annotation.ColorInt;
import androidx.annotation.Dimension;
import androidx.annotation.RestrictTo;
import androidx.annotation.RestrictTo.d;
import com.google.android.material.card.MaterialCardView;
import o.aqu.n;

@RestrictTo({d.LIBRARY_GROUP})
public class ari {
    private int ˊ;
    private int ˋ;
    private final MaterialCardView ॱ;

    public ari(MaterialCardView materialCardView) {
        this.ॱ = materialCardView;
    }

    public void ˋ(TypedArray typedArray) {
        this.ˊ = typedArray.getColor(n.ˊˈ, -1);
        this.ˋ = typedArray.getDimensionPixelSize(n.ˊˑ, 0);
        ॱ();
        ˋ();
    }

    public void ˊ(@ColorInt int i) {
        this.ˊ = i;
        ॱ();
    }

    public void ˏ(@Dimension int i) {
        this.ˋ = i;
        ॱ();
        ˋ();
    }

    public void ॱ() {
        this.ॱ.setForeground(ˊ());
    }

    private Drawable ˊ() {
        Drawable gradientDrawable = new GradientDrawable();
        gradientDrawable.setCornerRadius(this.ॱ.ʽ());
        if (this.ˊ != -1) {
            gradientDrawable.setStroke(this.ˋ, this.ˊ);
        }
        return gradientDrawable;
    }

    private void ˋ() {
        this.ॱ.setContentPadding(this.ॱ.m_() + this.ˋ, this.ॱ.ॱ() + this.ˋ, this.ॱ.n_() + this.ˋ, this.ॱ.o_() + this.ˋ);
    }
}
